/**
 * author: 何其沆(pooky)
 * desc: Performance - api
 * date: 2022-02-18
 */
import { get, post } from '@/utils/request.js'
import api from '@/config/index.js'

export default {
  /**
   * 获取Performance列表
   * @returns {Promise | Promise<unknown>}
   */
  getPerformanceList(data) {
    return post(api.API_VERSION + '/Others/Performance/QueryPages', data, false)
  },
  /**
   * 获取Received Payment数据
   * @param data
   * @returns {Promise<unknown>}
   */
  getReceivedPayment(data) {
    return get(api.API_VERSION + '/Others/Performance/GetPerformanceInvoice', data, false)
  },
  /**
   * 导出Received Payment数据
   * @param data
   * @returns {Promise<unknown>}
   */
  exportReceivedPayment(data) {
    return get(api.API_VERSION + '/Others/Performance/ExportPerformanceInvoice', data, false, true)
  },
  /**
   * 获取Permission Range数据
   * @param data
   * @returns {Promise<unknown>}
   */
  getPermissionRange(data) {
    return get(api.API_VERSION + '/Others/Performance/GetPerformanceCalculate', data, false)
  },
  /**
   * 获取Sales Division列表
   * @returns {Promise<unknown>}
   */
  getSalesDivision() {
    return get(api.API_VERSION + '/Admin/Others/Commission/GetSalesDivisionList', {}, false)
  },
  /**
   * 获取Sales Division/Commission
   * @param data
   * @returns {Promise<unknown>}
   */
  getSdCommission(data) {
    return get(api.API_VERSION + '/Admin/Others/Commission/GetPerformanceResult', data, false)
  },
  /**
   * 获取管理端Received Payment数据
   * @param data
   * @returns {Promise<unknown>}
   */
  getAdminReceivedPayment(data) {
    return get(api.API_VERSION + '/Admin/Others/Commission/GetPerformanceInvoice', data, false)
  },
  /**
   * 导出管理端Received Payment数据
   * @param data
   * @returns {Promise<unknown>}
   */
  exportAdminReceivedPayment(data) {
    return get(api.API_VERSION + '/Admin/Others/Commission/ExportPerformanceInvoice', data, false, true)
  },
  /**
   * 获取管理端Permission Range数据
   * @param data
   * @returns {Promise<unknown>}
   */
  getAdminPermissionRange(data) {
    return get(api.API_VERSION + '/Admin/Others/Commission/GetPerformanceCalculate', data, false)
  },
  /**
   * 获取用户信息
   * @param data
   * @returns {Promise<unknown>}
   */
  getPerformanceInfo(data) {
    return get(api.API_VERSION + '/Others/Performance/GetPerformanceInfo', data, false)
  },
  /**
   * 获取管理端用户信息
   * @param data
   * @returns {Promise<unknown>}
   */
  getAdminPerformanceInfo(data) {
    return get(api.API_VERSION + '/Admin/Others/Commission/GetPerformanceInfo', data, false)
  },
  /**
   * 导出
   * @param data
   * @returns {Promise<unknown>}
   */
  exportPerformanceSaleResult(data) {
    return get(api.API_VERSION + '/Admin/Others/Commission/ExportPerformSaleResult', data, false, true)
  },
  /**
   * 个人端获取New客户业绩详情
   * @param data
   */
  getPerformanceNewClients(data) {
    return get(api.API_VERSION + '/Others/Performance/GetPerformanceNewClients', data, false)
  },
  /**
   * 个人端获取Existing客户业绩详情
   * @param data
   */
  getPerformanceExistingClients(data) {
    return get(api.API_VERSION + '/Others/Performance/GetPerformanceExistingClients', data, false)
  },
  /**
   * 管理端获取New客户业绩详情
   * @param data
   */
  getAdminPerformanceNewClients(data) {
    return get(api.API_VERSION + '/Admin/Others/Commission/GetPerformanceNewClients', data, false)
  },
  /**
   * 管理端获取Existing客户业绩详情
   * @param data
   */
  getAdminPerformanceExistingClients(data) {
    return get(api.API_VERSION + '/Admin/Others/Commission/GetPerformanceExistingClients', data, false)
  }
}
